Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • margins plot for*interaction of two continuous variables

    Hi, I am trying to create a margins plot to illustrate the interaction term between savings rate (% of GDP, continuous and can take on decimal numbers, call this X1) and a terrorism index that I have created (where 0= no terrorism, 100= worst terrorism in the period, continuous and can take on decimal numbers, call this X2).

    margins, at(indexBiNEW=(0(1)100)) at(save=(0(1)23))
    marginsplot

    These commands aren't giving me what I am looking for I don't think. I want to be able to graph how the interaction term between these variables changes over time- can anyone help? Is this margins command correct? It creates a very squished up graph that is unreadable.

    Thanks.

  • #2
    You'll increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data. Being able to replicate your problem and know exactly what your data look like is essential to helping you.

    This may help:
    clear
    sysuse auto
    reg price c.mpg##c.weight
    margins , at(mpg=(1(3)50) weight=(3000 4000))

    Comment

    Working...
    X